#include <sys/time.h>
#include <stdio.h>

void delay()
{
	unsigned int i,j;
	for(i=0;i<10000;i++)
	{
		for(j=0;j<10000;j++);
	}
}

int main()
{
	struct timeval tv_begin, tv_end;
	unsigned int timeuse;
	
	gettimeofday(&tv_begin, NULL);
	delay();
	gettimeofday(&tv_end, NULL);

	timeuse = 1000000*(tv_end.tv_sec - tv_begin.tv_sec)+
		  (tv_end.tv_usec - tv_begin.tv_usec);
	printf("Used time:%d us \n",timeuse);
	return 0;
}
